﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Home_ListCatelogiesByPlatform : System.Web.UI.Page
{
    public CategoryAdapter cateAdap;
    public PlatformAdapter platformAdap;
    
    UserEntity currentUser;
    public long platformID;
    public LanguageManage Language;
    public string title="";
    protected void Page_Load(object sender, EventArgs e)
    {
        //Check login
        currentUser = UserManager.Instance.Getuser();
        if (!currentUser.isLogin)
            Response.Redirect("~/Login.aspx");

        Language = new LanguageManage();
        
        if (Request.QueryString["platformid"] != null)
        {
            platformID = Convert.ToInt32(Request.QueryString["platformid"]);
            Session["menu_current"] = Session["menu_id"];
            Session["platformid"] = platformID;
            cateAdap = new CategoryAdapter();
            platformAdap=new PlatformAdapter();
            ListCategory1.listCategory = cateAdap.getListCategoriesByPlatform(platformID);
            ListCategory1.isDisplayItem = true;
            title += Language["Categories"] + " - " + platformAdap.GetPlatformByID(platformID).First().Name;
        }

    }
}